#ifndef PLAYERCOMMANDS_H
#define PLAYERCOMMANDS_H

#include <GameGlobals.h>
#include <map>

class PlayerInterface;

#define Command( FunctionName ) \
	void FunctionName( PlayerInterface& pi )

#define MapKey( Map, Key, Command )										\
	if( ControlSets::Map.find( Key ) == ControlSets::Map.end() )		\
{	ControlSets::Map[ Key ] = &PlayerCommands::Command;	}				\
	else {																\
	std::cerr<<"Error! Key: "<<Key <<" already present in map!\n"; }

namespace ControlSets
{
extern 
std::map<unsigned char, void (*)(PlayerInterface&)> default_controls;
extern 
std::map<unsigned char, void (*)(PlayerInterface&)> default_walk_controls;
extern 
std::map<unsigned char, void (*)(PlayerInterface&)> current_controls;
extern 
std::map<unsigned char, void (*)(PlayerInterface&)> menu_controls;
}

namespace PlayerCommands
{
	Command( MoveForward );
	Command( TurnLeft );
	Command( TurnRight );
	Command( SlowDown );
	
	Command( Walk_MoveForward );
	Command( Walk_MoveBackward );
	Command( Walk_TurnLeft );
	Command( Walk_TurnRight );
}

namespace RunOnce
{
	void GenerateControlSets();
}


#endif